Skip to content

Send an EC to bidders only when its consented row was read - #1640

Open
dhruv8sh wants to merge 3 commits into
fix/pull-sync-full-rowfrom
fix/user-id-requires-row
Open

dhruv8sh wants to merge 3 commits into
fix/pull-sync-full-rowfrom
fix/user-id-requires-row

Conversation

@dhruv8sh

Copy link
Copy Markdown
Collaborator

Summary

  • A well-formed ts-ec cookie whose row does not exist was still sent to bidders as user.id and request.id = ts-{ec}, and orphan recovery then rotated that EC on the same navigation. Bidders now get the EC only when the request read a consented row for it.
  • Applies to the navigation auction, /_ts/page-bids and /auction. This is bidder-visible, so it has a CHANGELOG entry.
  • Adapters without an EC store (Axum, Cloudflare, Spin) have no rows to read, so they keep sending the consented EC as before.

Changes

File Change
crates/trusted-server-core/src/auction/endpoints.rs New bidder_ec_id: returns the EC only when the snapshot holds a consented row (or there is no EC store). Used by /auction; /auction and page-bids now read the row whenever an EC store exists. Unit tests for unread, missing, unreadable, withdrawn and consented rows and for no store.
crates/trusted-server-core/src/publisher.rs Navigation auction decides user.id after the row read; page-bids corrects its trace request through set_auction_ec_identity once the row is read. Handler tests for row and no-row cases.
CHANGELOG.md "Breaking (bidder-visible)" entry, including the no-store exception.
docs/superpowers/specs/2026-10-30-s2s-eid-collection-design.md Compatibility note for the consented-row rule.

Closes

Closes #1549

Spec

Not a feature (bug fix; follow-up from #1487, design in docs/superpowers/specs/2026-10-30-s2s-eid-collection-design.md).

Test plan

  • cargo test-fastly && cargo test-axum (also test-cloudflare, test-spin)
  • cargo clippy-fastly && cargo clippy-axum (also clippy-cloudflare, clippy-spin-native)
  • cargo fmt --all -- --check
  • JS tests: cd crates/trusted-server-js/lib && npx vitest run (no JS changes)
  • JS format: cd crates/trusted-server-js/lib && npm run format (no JS changes)
  • Docs format: prettier on the changed markdown
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve

Checklist

  • Feature PRs: spec linked above, ending in a review log of two or more agent review rounds (not a feature)
  • Changes follow AGENTS.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses log macros (not println!)
  • New code has tests
  • No secrets or credentials committed

A well-formed ts-ec cookie whose row did not exist still went to bidders as user.id and as the ts-{ec} request ID on the navigation auction, /_ts/page-bids and /auction, although orphan recovery replaces that EC on the navigation. With an EC store, the EC now goes to bidders only when the request snapshot holds a consented row for it, the rule identity providers already follow. /_ts/page-bids and /auction read the row whenever an EC store exists, and a navigation without Fetch Metadata that runs an auction reads it too. Without an EC store no row exists and no EC is replaced, so the consented EC is still sent. The change is bidder-visible and recorded in the changelog.

Closes #1549.

Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
State that adapters without an EC KV store (Axum, Cloudflare, Spin) still send the consented EC as user.id, and record the consented-row rule in the S2S EID spec's compatibility notes.

Signed-off-by: dhruv8sh <dhruv8sh@proton.me>
Signed-off-by: dhruv8sh <dhruv8sh@proton.me>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not send a cookie EC with no row as user.id

1 participant